#include <cppunit/config/SourcePrefix.h>
#include "Parser_UsesTest.h"
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <stdio.h>
using namespace std;

void
Parser_UsesTest::setUp()
{}
void
Parser_UsesTest::tearDown()
{}

CPPUNIT_TEST_SUITE_REGISTRATION( Parser_UsesTest );

void Parser_UsesTest::testParser_Uses(){
	cout << "Testing : Parser to Uses" << endl;
	//parse the SIMPLE source code into the parser
	PKB* pkb = new PKB();
	Parser* p = new Parser(pkb);
	p->startParsing("../Release/src.txt"); 
	
	stringstream ss;
	
	/*// verify that usesStmtTable is correct
	for (auto it = pkb->uses->usesTableStmt.begin(); it != pkb->uses->usesTableStmt.end(); ++it) {
		ss << it->first << " : " << it->second << endl;
	}
	cout << "Uses: " << ss.str() << endl;
	CPPUNIT_ASSERT("1 : 2\n1 : 3\n1 : 4\n2 : 1\n3 : 5\n4 : 1\n5 : 7\n6 : 8\n" == ss.str());
	ss.clear();
	ss.str(" ");*/

	cout << "Test OK: Parser to Uses" << endl;
}